package com.ruoyi.system.service.impl;
/**
 * ClassName: NewServiceImpl <br/>
 * Description: <br/>
 * date: 2020/3/24 9:44<br/>
 *
 * @author Hesion<br />
 * @version
 * @since JDK 1.8
 */

import com.ruoyi.system.domain.SysNews;
import com.ruoyi.system.domain.SysTask;
import com.ruoyi.system.mapper.NewsMapper;
import com.ruoyi.system.service.INewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.UUID;

/**
 * @program: ruoyi
 * @description:
 * @author: hesion
 * @create: 2020-03-24 09:44
 **/
@Service
public class NewServiceImpl implements INewService {
    @Autowired
    NewsMapper newsMapper;

    @Override
    public List<SysNews> selectNewsList(SysNews sysNews) {
        return newsMapper.selectNewsList(sysNews);
    }

    @Override
    public SysNews selectNewsById(String id) {
        return newsMapper.selectNewsById(id);
    }

    @Override
    public Integer edit(SysNews sysNews) {
        sysNews.setUpdateTime(new Date());
        return newsMapper.edit(sysNews);
    }

    @Override
    public Integer remove(String id) {

        return newsMapper.remove(id);
    }

    @Override
    public Integer add(SysNews sysNews) {

        sysNews.setCreateTime(new Date());
        sysNews.setDel_flag("0");
        return newsMapper.add(sysNews);
    }
}
